<?php
use common\models\Article;
?>
<?php $this->beginBlock('keywords'); ?><?=$info['seo_keyword'];?><?php $this->endBlock();?>
<?php $this->beginBlock('description'); ?><?=$info['seo_description'];?><?php $this->endBlock();?>

<script type="text/javascript" src="<?= \Yii::$app->request->baseUrl;?>/js/iscroll.js"></script>
<script type="text/javascript">
window.onload=function(){
    var Imglength=$(".detail_img_in img").length;
	var Imgwidth=$(".detail_img_in li img").width();
	$(".detail_img_in").width(Imgwidth*Imglength+Imglength*10+1);
    var myScroll = new IScroll('#wrapper', {
		 eventPassthrough: true,
		 scrollX: true,
		 scrollY: true,
		 preventDefault: false ,
		 hScrollbar :true,
		 scrollbars: 'custom'
	 });
}
</script>

<div class="me_shadow public new_public">
    <div class="hot_game new_hot_game">
        <ul>
            <li><a href="<?=Yii::$app->urlManager->createUrl(['/game/download','game_version_id'=>$model['id']]);?>" onclick="plus()">
               <p class="p1"><img src="<?=filepath($model['game']['game_logo']);?>" class="myimg"></p>
               <p class="p2">
                  <span class="span1"><?=$model['game']['game_name'];?></span>
                  <span class="span2"><?=$model['version_size']?>MB <br><i>
                  <?php foreach($types as $type):?>
                  <?=$type['type_name'].' ';?>
                  <?php endforeach;?>
                  </i>下载：<em id="downloadnum"><?=$model['game']['game_downclick']?></em></span>
               </p>
               <p class="p3"><span>下载</span></p>
            </a></li>
        </ul>
     </div>
     <div class="detail_img" id="wrapper">
         <div id="scroller" class="detail_img_in">
             <ul>
                  <?php echo $album; ?>
              </ul>
          </div>
    </div>
</div>

    <!--简介-->
  <div class="me_shadow public">
     <div class="tit"><p class="p7">简介</p></div>

     <div class="detail_font">
          <?=$model['game']['short_introduce'];?>
     </div>
  </div>

    <!--资讯 -->
  <?php if($news):?>
  <div class="me_shadow public">
     <div class="tit"><p class="p1">资讯</p></div>
     <div class="game_news">
        <ul>
            <?php foreach($news as $article):?>
                <li><p><a href="<?=Yii::$app->urlManager->createUrl(['/article/detail','id'=>$article['id']]);?>"><?=truncate($article['title'],25);?></a></p></li>
            <?php endforeach;?>
        </ul>
     </div>
     <div class="morelist"><a href="<?=Yii::$app->urlManager->createUrl(['/game/article-list','version_id'=>$model['id'],'kind'=>Article::KIND_NEWS]);?>">浏览更多资讯</a></div>
  </div>
  <?php endif;?>

<!--活动-->
<?php if($acticity):?>
<div class="me_shadow public">
    <div class="tit"><p class="p8">活动</p></div>
    <div class="game_news">
        <ul>
            <?php foreach($acticity as $article):?>
                <li><p><a href="<?=Yii::$app->urlManager->createUrl(['/article/detail','id'=>$article['id']]);?>"><?=truncate($article['title'],25);?></a></p></li>
            <?php endforeach;?>
        </ul>
    </div>
    <div class="morelist"><a href="<?=Yii::$app->urlManager->createUrl(['/game/article-list','version_id'=>$model['id'],'kind'=>Article::KIND_ACTIVITY]);?>">浏览更多活动</a></div>
</div>
<?php endif;?>

<!--同类游戏 -->
<?php if($same_games):?>
<div class="me_shadow public">
     <div class="tit"><p class="p6">同类游戏</p></div>
     <div class="new_online">
        <ul class="clearfix">
            <?php foreach($same_games as $game):?>
            <li><a href="<?=Yii::$app->urlManager->createUrl(['/game/detail','version_id'=>$game['id']])?>"><img src="<?=filepath($game['game']['game_logo']);?>" class="myimg"><span><?=$game['game']['game_name'];?></span><em>下载</em></p></a></li>
            <?php endforeach;?>
        </ul>
     </div>
 </div>
 <?php endif;?>

 <input type="hidden" name="_csrf" id="_csrf" value="<?=\Yii::$app->request->csrfToken; ?>" />
<script type="text/javascript">
function plus(){
	 var num=$("#downloadnum").text();
	 $("#downloadnum").text(parseInt(num)+1);
}
</script>